<!-- Demo version: 2018.11.17 -->

<!DOCTYPE html>
<html lang="en" dir="ltr">
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
  <title>Admin on RTCMultiConnection</title>

  <link rel="shortcut icon" href="/demos/logo.png">

  <link href="/demos/css/bootstrap.min.css" rel="stylesheet">
  <script src="/demos/js/jquery-3.3.1.slim.min.js"></script>
  <script src="/demos/js/popper.min.js"></script>
  <script src="/demos/js/bootstrap.min.js"></script>
  <script src="/socket.io/socket.io.js"></script>

<style type="text/css">
html, body, section, ul, li, nav, a, h1, h2 {
    padding: 0;
    margin: 0;
    outline: none;
    text-shadow: none;
    box-shadow: none;
    border-radius: 0;
    text-decoration: none;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Fira Sans", "Droid Sans", "Helvetica Neue", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
    font-size: 17px;
    line-height: 1.5em;
}

header {
  border-bottom: 1px solid #95d4e7;
  height: 70px;
}

a {
    color: #EC008C;
}

a:hover {
    color: #671345;
}

.logo {
    float: left;
    margin-left: 20px;
    display: block;
    height: 55px;
}

.logo-text {
    font-size: 24px;
    display: inline-block;
    margin-top: 15px;
    margin-left: 9px;
    font-weight: bold;
    color: #0194ff;
}

section {
  border-bottom: 1px solid #95d4e7;
  padding: 5px 20px;
}

.table {
  overflow: auto;
  width: 100%;
  max-width: 100%;
  margin-bottom: 1rem;
  border-left: 1px solid #eceeef;
  border-bottom: 1px solid #eceeef;
}

.table th,
.table td {
  padding: 0.75rem;
  vertical-align: top;
  border-top: 1px solid #eceeef;
  border-right: 1px solid #eceeef;
}

.table thead th {
  vertical-align: bottom;
  border-bottom: 2px solid #eceeef;
}

.table tbody + tbody {
  border-top: 2px solid #eceeef;
}

.table .table {
  background-color: #fff;
}

.table-sm th,
.table-sm td {
  padding: 0.3rem;
}

.table-bordered {
  border: 1px solid #eceeef;
}

.table-bordered th,
.table-bordered td {
  border: 1px solid #eceeef;
}

.table-bordered thead th,
.table-bordered thead td {
  border-bottom-width: 2px;
}

.table-striped tbody tr:nth-of-type(odd) {
  background-color: rgba(0, 0, 0, 0.05);
}

.table-hover tbody tr:hover {
  background-color: rgba(0, 0, 0, 0.075);
}

.table-active,
.table-active > th,
.table-active > td {
  background-color: rgba(0, 0, 0, 0.075);
}

.table-hover .table-active:hover {
  background-color: rgba(0, 0, 0, 0.075);
}

.table-hover .table-active:hover > td,
.table-hover .table-active:hover > th {
  background-color: rgba(0, 0, 0, 0.075);
}

.table-success,
.table-success > th,
.table-success > td {
  background-color: #dff0d8;
}

.table-hover .table-success:hover {
  background-color: #d0e9c6;
}

.table-hover .table-success:hover > td,
.table-hover .table-success:hover > th {
  background-color: #d0e9c6;
}

.table-info,
.table-info > th,
.table-info > td {
  background-color: #d9edf7;
}

.table-hover .table-info:hover {
  background-color: #c4e3f3;
}

.table-hover .table-info:hover > td,
.table-hover .table-info:hover > th {
  background-color: #c4e3f3;
}

.table-warning,
.table-warning > th,
.table-warning > td {
  background-color: #fcf8e3;
}

.table-hover .table-warning:hover {
  background-color: #faf2cc;
}

.table-hover .table-warning:hover > td,
.table-hover .table-warning:hover > th {
  background-color: #faf2cc;
}

.table-danger,
.table-danger > th,
.table-danger > td {
  background-color: #f2dede;
}

.table-hover .table-danger:hover {
  background-color: #ebcccc;
}

.table-hover .table-danger:hover > td,
.table-hover .table-danger:hover > th {
  background-color: #ebcccc;
}

.thead-inverse th {
  color: #fff;
  background-color: #292b2c;
}

.thead-default th {
  color: #464a4c;
  background-color: #eceeef;
}

.table-inverse {
  color: #fff;
  background-color: #292b2c;
}

.table-inverse th,
.table-inverse td,
.table-inverse thead th {
  border-color: #fff;
}

.table-inverse.table-bordered {
  border: 0;
}

.table-responsive {
  display: block;
  width: 100%;
  overflow-x: auto;
  -ms-overflow-style: -ms-autohiding-scrollbar;
}

.table-responsive.table-bordered {
  border: 0;
}

.clickable {
  border-bottom: 1px dotted blue;
  padding-bottom: 2px;
  cursor: pointer;
  display: inline-block;
}

.tab {
  display: inline-block;
  width: 20px;
}

header div .top-span, header div button {
  display: inline-block!important;
  margin-right: 25px;
  padding: 2px 8px;
  font-size: 14px;
}

#logs-viewer {
  height: 400px;
  overflow: auto;
  padding: 0;
  border: 0;
}

#logs-viewer tr:first-child td {
  border-top: 0;
}

pre {
  margin: 0;
  padding: 0;
}

input[disabled], button[disabled] {
  background: transparent!important;
  color: #dcd7d7!important;
  border-color: #dcd7d7!important;
  cursor: not-allowed!important;
}

.max-width {
  max-width: 150px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
}

.new-updates-notifier {
  text-align: center;
  display: none;
}

.new-updates-notifier span {
    background: yellow;
    display: inline-block;
    border: 1px solid red;
    padding: 5px 22px;
    border-top: 0;
    border-bottom-left-radius: 10px;
    border-bottom-right-radius: 10px;
}

.new-updates-notifier a {
  border-bottom: 1px dotted;
  text-decoration: none!important;
}

.new-updates-notifier label {
  margin: 0 5px;
  color: #EC008C;
  border-bottom: 1px dotted;
  cursor: pointer;
}

.new-updates-notifier input {
    vertical-align: middle;
}
</style>
</head>
<body>
  <div class="new-updates-notifier">
    <span>There are new updates. Do you want to refresh? <label><input type="checkbox"> auto update</label> or <a href="">Refresh</a></span>
  </div>

  <header style="margin-bottom: 20px;">
    <img class="logo" src="/demos/logo.png" alt="RTCMultiConnection" /> <span class="logo-text">Admin</span>

    <div style="float: right;margin-top: 15px;">
      <button class="btn btn-primary" data-toggle="modal" data-target="#exampleModal">Search User</button>

      <span class="top-span">Signaling-Server ( users: <span id="active-users">0</span>, rooms: <span id="active-rooms">0</span><!--, Sockets: <span id="all-sockts">0</span>  --> )</span>
      <span class="top-span">Scalable-Broadcast ( users: <span id="scalable-users">0</span> )</span>

      <span id="view-logs" class="clickable tooltip-test top-span" title="View All Nodejs Coding Error Logs" data-toggle="modal" data-target=".bd-example-modal-lg">Error Logs</span>
    </div>
  </header>

  <div class="modal fade bd-example-modal-lg" tabindex="-1" role="dialog" aria-labelledby="myLargeModalLabel" aria-hidden="true">
    <div class="modal-dialog modal-lg">
      <div class="modal-content">
        <div class="modal-header">
          <h5 class="modal-title">Logs Viewer</h5>
          <button type="button" class="close" data-dismiss="modal" aria-label="Close">
            <span aria-hidden="true">&times;</span>
          </button>
        </div>

        <div class="modal-body" style="padding: 0;">
          <section id="logs-viewer"></section>
        </div>
      </div>
    </div>
  </div>

  <div class="modal fade" id="exampleModal" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true">
    <div class="modal-dialog" role="document">
      <div class="modal-content">
        <div class="modal-header">
          <h5 class="modal-title" id="exampleModalLabel">Get User Information</h5>
          <button type="button" class="close" data-dismiss="modal" aria-label="Close">
            <span aria-hidden="true">&times;</span>
          </button>
        </div>
        <div class="modal-body">
          <form>
            <div class="form-group">
              <label for="txt-userid" class="col-form-label">Enter User ID:</label>
              <input type="text" class="form-control" id="txt-userid" placeholder="Enter user-id">
            </div>
          </form>
        </div>
        <div class="modal-footer">
          <button type="button" class="btn" data-dismiss="modal">Close</button>
          <button type="button" class="btn btn-primary" id="view-userinfo">Search</button>
        </div>
      </div>
    </div>
  </div>

  <div id="confirm-box-topper" style="display:none;z-index:99999999;top:0;left:0;
        bottom:0;right:0;width:100%;height:100%;position:fixed;background:#000000ad;"></div>
  <div id="alert-box" class="modal fade" style="display:none;z-index:999999999999999;">
            <div class="modal-dialog">
                <div class="modal-content">
                    <div class="modal-header">
                        <h5 class="modal-title" id="alert-title">Alert</h5>
                        <button type="button" class="close btn-alert-close" data-dismiss="modal" aria-label="Close">
                          <span aria-hidden="true">&times;</span>
                        </button>
                    </div>
                    <div class="modal-body">
                        <div id="alert-message" class="model-list"></div>
                    </div>

                    <div class="modal-footer">
                        <p id="alert-special"></p>
                        <button class="btn btn-primary btn-alert-close">Close</button>
                    </div>
                </div>
            </div>
  </div>

  <div id="confirm-box" class="modal fade" style="display:none;z-index:999999999999999;">
            <div class="modal-dialog">
                <div class="modal-content">
                    <div class="modal-header">
                        <h5 class="modal-title" id="confirm-title">Please Confirm</h5>
                        <button type="button" class="close btn-confirm-close" data-dismiss="modal" aria-label="Close">
                          <span aria-hidden="true">&times;</span>
                        </button>
                    </div>
                    <div id="confirm-message" class="modal-body"></div>

                    <div class="modal-footer">
                        <button class="btn btn-confirm-close" id="btn-confirm-close">Cancel</button>
                        <button class="btn btn-primary" id="btn-confirm-action">Confirm</button>
                    </div>
                </div>
            </div>
        </div>

  <div class="modal fade" id="adminPasswordModel" tabindex="-1" role="dialog" aria-labelledby="adminPasswordModelLabel" aria-hidden="true">
    <div class="modal-dialog" role="document">
      <div class="modal-content">
        <div class="modal-header">
          <h5 class="modal-title" id="adminPasswordModelLabel">Admin Credentials</h5>
          <button type="button" class="close close-admin-credentials-box" data-dismiss="modal" aria-label="Close">
            <span aria-hidden="true">&times;</span>
          </button>
        </div>
        <div class="modal-body">
          <form>
            <div class="form-group">
              <p>
                <label for="txt-admin-username" class="col-form-label">Enter Admin UserName:</label>
                <input type="text" class="form-control" id="txt-admin-username">
              </p>

              <p>
                <label for="txt-admin-password" class="col-form-label">Enter Admin Password:</label>
                <input type="password" class="form-control" id="txt-admin-password">
              </p>
            </div>
          </form>
        </div>
        <div class="modal-footer">
          <button type="button" class="btn close-admin-credentials-box" data-dismiss="modal">Close</button>
          <button type="button" class="btn btn-primary" id="btn-validate-admin">Validate</button>
        </div>
      </div>
    </div>
  </div>

  <section style="min-height: 400px;">
    <table class="table">
      <thead>
        <tr>
          <th>#</th>
          <th>Room ID</th>
          <th>Owner ID</th>
          <th>Identifier</th>
          <th>socketMessageEvent</th>
          <th>Session</th>
          <th>Extra</th>
          <th>Participants</th>
          <th>Delete</th>
        </tr>
      </thead>
      <tbody id="rooms-list"><tr><td colspan=8>No active room found on this server.</td></tr></tbody>
    </table>
  </section>

  <section style="min-height: 400px; display: none;">
    <table class="table">
      <thead>
        <tr>
          <th>#</th>
          <th>User ID</th>
          <th>Room ID</th>
          <th>Session</th>
          <th>Extra</th>
          <th>streams</th>
          <th>mediaConstraints</th>
          <th>sdpConstraints</th>
          <th>connectedWith</th>
          <th>Delete</th>
        </tr>
      </thead>
      <tbody id="users-list"><tr><td colspan=8>No active users found on this server.</td></tr></tbody>
    </table>
  </section>
  
  <footer style="text-align: center;">RTCMultiConnection | Admin Page</footer>

  <script src="/admin/admin-ui.js"></script>
</body>
</html>
